﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hrm.Core
{
    [Serializable]
    public class Resource : Entity
    {
        [MaxLength(20)]
        [Display(Name="资源编码")]
        public string Code { get; set; }

        [MaxLength(20)]
        [Display(Name = "资源名称")]
        public string Name { get; set; }

        [MaxLength(20)]
        [Display(Name = "资源类型")]
        public string Type { get; set; }

        [MaxLength(20)]
        [Display(Name = "资源父类")]
        public string ParentCode { get; set; }

        [Display(Name = "资源排序")]
        public int Order { get; set; }

        [MaxLength(200)]
        [Display(Name = "资源地址")]
        public string Url { get; set; }

        [MaxLength(50)]
        [Display(Name = "资源图标")]
        public string GlyphiconsClass { get; set; }

        [MaxLength(200)]
        [Display(Name = "资源描述")]
        public string Description { get; set; }

        [JsonIgnore]
        public virtual Application Application { get; set; }

        [JsonIgnore]
        public virtual ICollection<ResourceAndPermission> ResourceAndPermissions { get; set; }
    }
}
